# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>

pkgname=lua-sdl2
pkgver=2.0.5.6.0
pkgrel=5
_lua=5.3
pkgdesc='Pure C binding of SDL 2.0 for Lua'
arch=(loong64 x86_64)
url='https://github.com/Tangent128/luasdl2'
license=(MIT)
depends=(lua53 sdl2_gfx sdl2_image sdl2_mixer sdl2_net sdl2_ttf)
makedepends=(cmake git ninja)
source=("git+$url#commit=01a749db3acf300dfd3eee3a6ba38dbe298d1081") # tag: v2.0.5-6.0
md5sums=('SKIP')

build() {
  mkdir -p build
  cd build
  cmake ../${pkgname/-} \
    -DWITH_LUAVER=${_lua/./} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DWITH_DOCSDIR="share/doc/$pkgname" \
    -G Ninja
  ninja
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
  install -Dm644 luasdl2/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim: ts=2 sw=2 et:
